<?php
if (!defined('IN_XLP')) {
    exit('Access Denied');
}
$Document = array(
    'pageid' => 'platform-index', //页面标示
    'pagename' => '平台管理', //当前页面名称
    'mycss' => array(), //加载的css样式表
    'myjs' => array(), //加载的js脚本
	//'footerjs'=>array('content/highcharts', 'content/exporting',),
    'footerjs'=>array('content/fuelux/fuelux','content/combodate/moment.min'),
    'head' => true, //加载头部文件
);

include getTpl('header', 'public');
?>
<!--顶部导航 开始-->
<?php include getTpl('top', 'public');?>
<!--顶部导航 结束-->
<!--左侧菜单 开始-->
<?php include getTpl('nav', 'public');?>
<!--左侧菜单 结束-->
<!--主体 开始-->
<!-- content -->
    <section id="content">
     <section class="main padder">
        <div class="clearfix"> 
          <h4><i class="fa fa-table"></i>平台管理</h4> 
        </div>
        <div class="row">
      
      <!-- table 11 -->
      <div class="col-lg-12"> 
        <section class="panel"> 
          <div class="panel-body"> 
            <div class="row text-small"> 
              <div class="col-sm-1 m-b-mini">
                <a href="<?php echo U('platform/add'); ?>" class="btn btn-sm btn-white">添加平台</a>
              </div>
            </div> 
          </div>
          <style>.table th,.table td,.table input{text-align:center;}</style>
          <div class="table-responsive"> 
            <table class="table table-striped b-t text-small"> 
              <thead> 
                <tr>
                  <th width="100">ID</th> 
                  <th width="200">名称</th>
                  <th width="200">编码</th>
                  <th width="50">排序</th>
                  <th width="200">是否收费</th>
                  <th width="200">状态</th>
                  <th width="50">操作</th> 
                </tr> 
              </thead> 
              <tbody>
              <?php if (count($list)): ?>
              <?php foreach ($list as $key => $value) { ?>
                <tr> 
                  <td><?php echo $value['id']; ?></td> 
                  <td style="color: #428bca"><?php echo $value['name']; ?></td>
                  <td><?php echo $value['abridge']; ?></td>  
                  <td><?php echo $value['sort']; ?></td> 
                  <td><?php echo $value['is_charge'] == 1 ? '是' : "<span class='red'>免费</span>"; ?></td> 
                  <td><?php echo $value['status'] == 1 ? '上架' : "<span class='red'>下架</span>"; ?></td> 
                  <td>
                    <div class="btn-group"> 
                      <button class="btn btn-white btn-xs dropdown-toggle" data-toggle="dropdown">操作<span class="caret"></span></button> 
                      <ul class="dropdown-menu"> 
                          <li><a href="<?php echo U('platform/edit',array('id'=>$value['id'])) ?>">编辑</a></li>
                          <li class="red"><a href="javascript:;" onclick="del('<?php echo $value['id']; ?>', this)">删除</a></li>
                      </ul>  
                    </div>
                  </td> 
                </tr>
              <?php } ?>
              <?php else: ?>
                <tr><td colspan="8" align="center">暂无数据</td></tr>
                <?php endif ?>
              </tbody> 
            </table> 
          </div> 
          <footer class="panel-footer"> 
            <div class="row"> 
              <div class="col-sm-12 text-right text-center-sm"> 
                <?php echo page($total,$page,'',20,'page');?>  
              </div> 
            </div> 
          </footer> 
        </section> 
      </div>
        </div> 
    </section>
  </section> 
  <!--/ content --> 
<!--主体 结束-->
<script>

/**
 * 删除分类
 */
 function del (id, obj) {
   $.get('<?php echo U('platform/ajax');?>',{type:'typeDel', id:id},function(result){
    Msg.hide();
    if (result.status==1){
      Msg.ok(result.info);
      var s = $(obj).parent().parent().parent().parent().parent().hide();
    }else{
      Msg.error(result.info);
    }
    },'json');
 }
</script>
<?php
include getTpl('footer', 'public');
?>